//  This file is part of Swordbible - http://www.swordwarrior.net
//  Copyright (C) 2003-2008 Manu Mital mitalmanu@hotmail.com

//  This program is free software; you can redistribute it and/or modify
//  it under the terms of the GNU General Public License as published by
//  the Free Software Foundation; either version 2, or (at your option)
//  any later version.

//  This program is distributed in the hope that it will be useful,
//  but WITHOUT ANY WARRANTY; without even the implied warranty of
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//  GNU General Public License for more details.

//  You should have received a copy of the GNU General Public License
//  along with this program; if not, write to the Free Software Foundation,
//  Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.


// CreateList.cpp : implementation file
//

#include "stdafx.h"
#include "SwordBible.h"
#include "CreateList.h"


// CCreateList dialog

IMPLEMENT_DYNAMIC(CCreateList, CDialog)

CCreateList::CCreateList(CWnd* pParent /*=NULL*/)
	: CDialog(CCreateList::IDD, pParent)
	, m_listName(_T(""))
{

}

CCreateList::~CCreateList()
{
}

void CCreateList::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	DDX_Text(pDX, IDC_EDIT_LISTNAME, m_listName);
	DDV_MaxChars(pDX, m_listName, 25);
}


BEGIN_MESSAGE_MAP(CCreateList, CDialog)
	ON_BN_CLICKED(IDOK, &CCreateList::OnBnClickedOk)
END_MESSAGE_MAP()


// CCreateList message handlers

void CCreateList::OnBnClickedOk()
{
	UpdateData(TRUE);

	if(m_listName.GetLength() < 3 || m_listName.GetLength() > 25)
		AfxMessageBox("List names must be between 3 and 25 characters");

	else
	{
		
		listName = m_listName;
		OnOK();
	}
}
